package com.deyuanyun.pic.ctrl.enumeration;

import com.deyuanyun.pic.ctrl.annotation.AutoEnum;

/**
 * 管道跨越段测试记录表-是否有异常
 *
 * @author scalpel.王敏
 * @version [v1.0] 创建时间（2016/9/12）
 * @see // 引用的类
 * Method List:
 * 1.----------------
 * 2.----------------
 * History:
 */
@AutoEnum(name="是否有异常",method = "getVal")
public enum  AbnormalEnum {
    YES("是"),
    NO("否"),
    UNKNOWN("未知");

    private String label;
    private AbnormalEnum(String label)
    {
        this.label=label;

    }

    public String getLabel() {
        return label;
    }

    public static String getVal(String lable)
    {

        AbnormalEnum rs[]= AbnormalEnum.values();
        for(int i=0,end=rs.length;i<end;i++)
        {
            if(rs[i].getLabel().equals(lable))
            {
                return rs[i].toString();
            }
        }
        return null;
    }

    public static String getLabel(String code) {
        AbnormalEnum rs[] = AbnormalEnum.values();
        for (int i = 0; i < rs.length; i++) {
            if (rs[i].toString().equals(code)) {
                return rs[i].getLabel();
            }
        }
        return null;
    }
}
